extends layout

block content
  - var time = format_unixtime(block.time)
  .col-xs-12.col-md-10.col-md-offset-1
    .well.well-sm.hidden-lg.hidden-md(style='word-wrap:break-word;')
      | #{block.hash}
    .panel.panel-default
      .panel-heading(style='padding-left:25px;padding-right:25px;')       
        .row           
          if block.previousblockhash != null
            a(href='/block/#{block.previousblockhash}')
              span.glyphicon.glyphicon-chevron-left.iquidus.block-last(data-toggle='tooltip', data-placement='top', title='#{settings.locale.block_previous}')  
            strong.hidden-xs #{settings.symbol} block: #{block.hash}
          else
            strong.hidden-xs(style='margin-left:10px;') #{settings.symbol} #{settings.locale.ex_block}: #{block.hash}
          if block.nextblockhash != null 
            a(href='/block/#{block.nextblockhash}')
              span.glyphicon.glyphicon-chevron-right.iquidus.pull-right.block-next(data-toggle='tooltip', data-placement='top', title='#{settings.locale.block_next}')       
          a(href='/api/getblock?hash=#{block.hash}')
            span.glyphicon.glyphicon-info-sign.iquidus.pull-right
      table.table.table-bordered.summary-table 
        thead
          tr
            th #{settings.locale.height}
            th #{settings.locale.difficulty}
            th #{settings.locale.confirmations}
            if settings.heavy == true
              th Vote
            th.hidden-xs #{settings.locale.size} (kB)
            th.hidden-xs #{settings.locale.bits}
            th.hidden-xs #{settings.locale.nonce}
            th.hidden-xs #{settings.locale.timestamp}
        tbody
          if block.confirmations >= confirmations                
            tr.success
              - var block_size = block.size/1024
              td #{block.height}
              td #{block.difficulty.toFixed(4)}
              td #{block.confirmations}
              if settings.heavy == true
                td  #{block.vote}
              td.hidden-xs #{block_size.toFixed(2)}
              td.hidden-xs #{block.bits}
              td.hidden-xs #{block.nonce}
              td.hidden-xs #{time}
          else
            if block.confirmations < (confirmations / 2)
              tr.danger
                - var block_size = block.size/1024
                td #{block.height}
                td #{block.difficulty.toFixed(4)}
                td #{block.confirmations}
                if settings.heavy == true
                  td  #{block.vote}
                td.hidden-xs #{block_size.toFixed(2)}
                td.hidden-xs #{block.bits}
                td.hidden-xs #{block.nonce}
                td.hidden-xs #{time}
            else
              tr.warning
                - var block_size = block.size/1024
                td #{block.height}
                td #{block.difficulty.toFixed(4)}
                td #{block.confirmations}
                if settings.heavy == true
                  td  #{block.vote}
                td.hidden-xs #{block_size.toFixed(2)}
                td.hidden-xs #{block.bits}
                td.hidden-xs #{block.nonce}
                td.hidden-xs #{time}

    if block.hash == settings.genesis_block
      .alert.alert-info(role='alert', style='text-align:center;')   
        strong #{settings.locale.block_genesis}
    else
      .panel.panel-default
        .panel-heading
          strong #{settings.locale.ex_latest_transactions}
        table.table.table-bordered.table-striped.summary-table 
          thead
            tr
              th.hidden-xs #{settings.locale.tx_hash}
              th #{settings.locale.tx_recipients}
              th #{settings.locale.mkt_amount} (#{settings.symbol})
              th
          tbody
            each txn in txs
              tr
                td.hidden-xs
                  a(href='/tx/#{txn.txid}') #{txn.txid}
                td #{txn.vout.length}
                if txn.vout.length > 0
                  - var total = txn.total / 100000000
                  td #{total.toFixed(8)}
                else
                  td #{txn.total.toFixed(8)}
                td.view_tx 
                  a(href='/tx/#{txn.txid}')
                    span.glyphicon.glyphicon-eye-open 
    .footer-padding  
